from celery import Celery
from celery_demo import celeryconfig

## 使用增加配置的方式创建celery app
app = Celery('celery_tasks.tasks')

# 从单独的配置模块中加载配置
app.config_from_object('celery_demo.celeryconfig')

# 自动搜索任务
app.autodiscover_tasks(['celery_demo'])
